﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IronSuit.DataMap;

namespace IronSuit.DataMap
{
	public partial class ISLog : DataEntity
	{
		public ISLog()
		{
		}
		public ISLog(int logId)
		{
			this.LogId = logId;

		}
		public int LogId
		{
			get
			{
				return GetFieldValue("LogId", int.MinValue);
			}
			set
			{
				SetFieldValue("LogId", value);
			}
		}
		public string LogLevel
		{
			get
			{
				return GetFieldValue("LogLevel", "");
			}
			set
			{
				SetFieldValue("LogLevel", value);
			}
		}
		public string Logger
		{
			get
			{
				return GetFieldValue("Logger", "");
			}
			set
			{
				SetFieldValue("Logger", value);
			}
		}
		public string LogUser
		{
			get
			{
				return GetFieldValue("LogUser", "");
			}
			set
			{
				SetFieldValue("LogUser", value);
			}
		}
		public DateTime LogTime
		{
			get
			{
				return GetFieldValue("LogTime", DateTime.MinValue);
			}
			set
			{
				SetFieldValue("LogTime", value);
			}
		}
		public string LogMessage
		{
			get
			{
				return GetFieldValue("LogMessage", "");
			}
			set
			{
				SetFieldValue("LogMessage", value);
			}
		}
		public string LogException
		{
			get
			{
				return GetFieldValue("LogException", "");
			}
			set
			{
				SetFieldValue("LogException", value);
			}
		}

		[NonSerialized]
		ISLogDBHandler DBHandler;
		protected override DataHandler GetDataHandler()
		{
			if (DBHandler == null)
				DBHandler = new ISLogDBHandler(this);
			return DBHandler;
		}
	}
	public partial class ISLogDBHandler : DataHandler
	{
		internal ISLogDBHandler(ISLog entity)
			: base(entity)
		{
			KeyFieldList.Add("LogId");

		}
		public override string TableName
		{
			get { return "IS_Log"; }
			set { }

		}
	}
}
